package com.coordinate.core.type.impl;

import com.google.appengine.api.datastore.Key;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import java.lang.Override;
import com.google.appengine.api.datastore.Text;

import com.coordinate.core.message.*;
import com.coordinate.core.type.LangText;

@PersistenceCapable
public class CLangText implements LangText{

	@PrimaryKey
	@Persistent(valueStrategy  = IdGeneratorStrategy.IDENTITY)
    private Key mKey;
	
	@Persistent
	private String mLangCode;
	
	@Persistent
	private String mLangCode1;
	
	@Persistent
	private Text mText;
	
	public CLangText() 
	{
		
	}
	
	public CLangText(String pCode, Text pText)
	{
		this.mLangCode = pCode;
		this.mText = pText;
	}
	
	public boolean isLangCode(String pCode) 
	{
	     return this.mLangCode.equals(pCode);
	}

	
	public Key getKey() {
		return mKey;
	}

	

	
	public String  getLangCode() {
		return mLangCode;
	}

	public void setLangCode(String pLangCode) {
		this.mLangCode = mLangCode;
	}

	public Text getText() {
		return mText;
	}

	public void setText(Text mText) {
		this.mText = mText;
	}

	@Override
	public String toString()
	{
		String lStr;
		lStr = "Language Code:" +this.mLangCode + "\n" + "Text:" + this.mText.getValue() + "\n";
	    return lStr;
	}
	
	
}
